]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
XDND: Allow workspace switching using the thumbnails
authorAdel Gadllah <adel.gadllah@gmail.com>
Mon, 21 Mar 2011 22:20:36 +0000 (23:20 +0100)
committerAdel Gadllah <adel.gadllah@gmail.com>
Mon, 21 Mar 2011 23:05:17 +0000 (00:05 +0100)
Currently activating a window on a different workspace requires very
long drag distances, which is very inconvenient to use.

Fix that by allowing switching workspaces using the thumbnails which is
consistent with window and launcher dnd and much easier to use.

https://bugzilla.gnome.org/show_bug.cgi?id=643945

js/ui/overview.js
js/ui/workspaceThumbnail.js
js/ui/workspacesView.js

index 40cd85272618499d895e5f9bb8c39fcb117a392d..351ba7c58f002d67f1dabe2d10eb870be948a046 100644 (file)
@@ -24,6 +24,7 @@ const PlaceDisplay = imports.ui.placeDisplay;
 const Tweener = imports.ui.tweener;
 const ViewSelector = imports.ui.viewSelector;
 const WorkspacesView = imports.ui.workspacesView;
+const WorkspaceThumbnail = imports.ui.workspaceThumbnail;
 
 // Time for initial animation going into Overview mode
 const ANIMATION_TIME = 0.25;
@@ -243,7 +244,8 @@ Overview.prototype = {
     _onDragMotion: function(dragEvent) {
         let targetIsWindow = dragEvent.targetActor &&
                              dragEvent.targetActor._delegate &&
-                             dragEvent.targetActor._delegate.metaWindow;
+                             dragEvent.targetActor._delegate.metaWindow &&
+                             !(dragEvent.targetActor._delegate instanceof WorkspaceThumbnail.WindowClone);
 
         this._windowSwitchTimestamp = global.get_current_time();
 
index d6334c6b32a9e4f933de9c9bbf737c0e89bba000..9d92f7b10b4337b17a63573e34cddfb5b9543fe0 100644 (file)
@@ -379,6 +379,11 @@ WorkspaceThumbnail.prototype = {
 
     // Draggable target interface
     handleDragOver : function(source, actor, x, y, time) {
+        if (source == Main.xdndHandler) {
+            this.metaWorkspace.activate(time);
+            return DND.DragMotionResult.CONTINUE;
+        }
+
         if (this.state > ThumbnailState.NORMAL)
             return DND.DragMotionResult.CONTINUE;
 
index f7250c649fa7e5554539c6a97c53b26494ea9a58..f791f9fb4ac69543431eea39231b8226c815cabf 100644 (file)
@@ -598,6 +598,14 @@ WorkspacesDisplay.prototype = {
         this._updateAlwaysZoom();
 
         global.screen.connect('monitors-changed', Lang.bind(this, this._updateAlwaysZoom));
+        Main.xdndHandler.connect('drag-begin', Lang.bind(this, function(){
+            this._alwaysZoomOut = true;
+        }));
+
+        Main.xdndHandler.connect('drag-end', Lang.bind(this, function(){
+            this._alwaysZoomOut = false;
+            this._updateAlwaysZoom();
+        }));
 
         this._nWorkspacesNotifyId = 0;
         this._switchWorkspaceNotifyId = 0;